using System;
using SpeakOut.Data.Interfaces;
using SpeakOut.Model;
using NHibernate.Criterion;

namespace SpeakOut.Data.NHibernate.Daos
{
    public class CategoryDao : BaseDao<Category>, ICategoryDao
    {
        public Category FindByName(string category)
        {
            return Session.CreateCriteria<Category>()
                .Add(Expression.Eq("Name", category).IgnoreCase())
                .UniqueResult<Category>();
        }
    }
}